﻿#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

#include"simpleLog.h"
#include "productInfo.h"


Logger logObj;

// 查找列名在标题行中的索引
int findIndex(const std::vector<std::string>& header, const std::string& columnName);

std::string readFile(const std::string& filePath, std::vector<std::string>& header, std::vector<std::vector<std::string>>& data);

// 合并文件
void mergeFiles(const std::string& produceInfoFile, const std::string& file2Path) {

  ProductInfo infoObj(produceInfoFile, logObj);

  if (!infoObj.InitSucc()) {
    logObj << "读取商品信息失败" << produceInfoFile << std::endl;
    return;
  }
  infoObj.ParseSellData(file2Path);
}



int run_main() {
  std::string file1Path = /*UTF8ToANSI*/("商品信息.txt");
  std::string file2Path = /*UTF8ToANSI*/("售卖信息.txt");
//  std::string outputPath = "merged_file.txt";

  mergeFiles(file1Path, file2Path);

  return 0;
}